$N("Archetype.ComponentDefinitions",$H());

/**
 * @author temsa
 * @name Archetype.component.abstractComponent
 * @class Archetype.component.abstractComponent
 * Describes the Standard Component Interface
 */
Archetype.ComponentDefinitions.set($U("Archetype.component.abstractComponent"),
/** @scope Archetype.component.abstractComponent.prototype */
{
	/**
	 * Name of the component.
	 * Your component will only be available if this is filled with the good classpath
	 */
	name : "Archetype.component.abstractComponent",
	/**
	 * Set up the Component dependencies
	 * The component won't launch main() unless
	 *  every dependencies in the setup are available
	 */
	setup : {
		dependencies:{components:{}, lib:[]}
	},
	/**
	 * constructor
	 */
	initialize :  _,
	/**
	 * Destroy the component by disconecting all event listening
	 */
	destroy: function() {
		for(var i = 0; i < this._destroy.length; i++) {
			if(this._destroy[i] == "archetypeEvent") {
				//Archetype.Events.removeEventListener(this._destroy[i + 1], this._destroy[i + 2]);
				Archetype.engine.stopObserving(this._destroy[i + 1], this._destroy[i + 2]);
				i += 2;
			}
			if(this._destroy[i] == "elementEvent") {
				//TODO check if there is no problem if element didn't exist anymore
				//Event.stopObserving(this._destroy[i + 1], this._destroy[i + 2], this._destroy[i + 3]);
				if(this._destroy[i + 1]) {
					this._destroy[i + 1].stopObserving(this._destroy[i + 2], this._destroy[i + 3]);
				}
				i += 3;
			}
		}
	}
});